package com.IO.Demo;

import cn.hutool.core.util.ReUtil;
import cn.hutool.http.HttpUtil;

import java.util.ArrayList;
import java.util.List;

public class d02 {
    public static void main(String[] args) {
        // 定义变量记录网址
        String familyNameNet = "https://hanyu.baidu.com/shici/detail?pid=0b2f26d4c0ddb3ee693fdb1137ee1b0d&from=kg0";
        String boyNameNet = "http://www.haoming8.cn/baobao/10881.html";
        String girlNameNet = "http://www.haoming8.cn/baobao/7641.html";
        String nameList = HttpUtil.get(familyNameNet);
        String boyList = HttpUtil.get(boyNameNet);
        String girlList = HttpUtil.get(girlNameNet);
        // ArrayList<String> familNameList = getData(s1, "([\\u4E00-\\u9FA5]{4})(，|。)", 1);
        // ArrayList<String> boyNameList = getData(s2, "([\\u4E00-\\u9FA5]{2})(、|。)", 1);
        // ArrayList<String> girlNameList = getData(s3, "(.. ){4}..", 0);
        List<String> nameAll = ReUtil.findAll("([\\u4E00-\\u9FA5]{4})(，|。)", nameList, 1);
        List<String> boyAll = ReUtil.findAll("([\\u4E00-\\u9FA5]{2})(、|。)", boyList, 1);
        List<String> girlAll = ReUtil.findAll("(.. ){4}..", girlList, 0);
    }
}
